﻿using AMAP.Domain;
using AMAP.ServiceInterfaces.Common;
using System.Security.Cryptography;

namespace AMAP.ServiceInterfaces
{
    public interface IAuthenticationService : IRepositoryService<User>
    {
        /// <summary>
        /// Check if given authentification informations are valid
        /// </summary>
        /// <param name="Email">User's email</param>
        /// <param name="Password">User's password</param>
        /// <returns>True if the given password match the given email address</returns>
        bool CheckAuthentication(string Email, string Password);

        /// <summary>
        /// Check if the given email address doesn't already exist in the database
        /// </summary>
        /// <param name="mailUser">email address</param>
        /// <returns>True is the given address email is available</returns>
        bool IsEmailAvailable(string mailUser);

        /// <summary>
        /// Check if a user have a role
        /// </summary>
        /// <param name="userName">User's email address</param>
        /// <param name="roleName">Given role</param>
        /// <returns>True if the given user have the given role</returns>
        bool IsUserInRole(string userName, string roleName);

        /// <summary>
        /// Return a user's role names array
        /// </summary>
        /// <param name="userName">User's email address</param>
        /// <returns>List of user's role names</returns>
        string[] GetUserRoles(string userName);

        /// <summary>
        /// Get all possible roles
        /// </summary>
        /// <returns>All possible roles</returns>
        string[] GetAllRoles();
    }
}
